﻿
@{
    ViewBag.Title = "我的账号";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<el-col :span="8" :offset="8" style="margin-top:35px;">
    <el-tabs type="border-card">
        <el-tab-pane label="个人信息">
            <el-form ref="form" label-width="70px">
                <el-form-item label="邮箱地址" style="text-align:left;">
                    <span>@User.Identity.Name</span>
                </el-form-item>
                <el-form-item label="账号类型" style="text-align:left;">
                    <span>免费</span> @*<el-button type="text">升级</el-button>*@
                </el-form-item>
                <el-form-item label="相册数量" style="text-align:left;">
                    <span>1 个</span>
                </el-form-item>
                @*<el-form-item label="相册容量" style="text-align:left;">
                        <span> <el-progress :percentage="70" :width="10" :stroke-width='12'></el-progress>2 G（剩余0.5G）</span>
                    </el-form-item>*@
            </el-form>
        </el-tab-pane>
        <el-tab-pane label="修改密码">
            <el-form ref="form" label-width="70px" :model="form">
                <el-form-item label="旧密码">
                    <el-input placeholder="请输入旧密码" v-model="form.oldpassword"></el-input>
                </el-form-item>
                <el-form-item label="新密码">
                    <el-input placeholder="请输入新密码" v-model="form.newpassword"></el-input>
                </el-form-item>
                <el-form-item label="确认密码">
                    <el-input placeholder="请输入确认密码" v-model="form.confirmpassword"></el-input>
                </el-form-item>
                <el-button type="primary" :loading="loging" @@click="submitSetPassword">确认修改</el-button>
            </el-form>
        </el-tab-pane>
    </el-tabs>
</el-col>
@section scripts{
    <script type="text/javascript">
        new Vue({
            el: "#app",
            data: {
                activeIndex: '8',
                defaultalbum: '默认相册',
                dropalbums: [],
                limit: 10,
                ismultiple: false,
                isshowfilelist: true,
                loging: false,
                form: {
                    oldpassword: '',
                    newpassword: '',
                    confirmpassword: ''
                }
            },
            methods: {
                handleSelect(key, keyPath) {
                    var self = this;
                    skipPage(self, key);
                },
                handleCommand() {

                },
                submitSetPassword() {
                    var self = this;
                    self.loging = true;
                    Axios.post(self, '/main/setpassword', {
                        data: {
                            oldpassword: self.form.oldpassword,
                            newpassword: self.form.newpassword,
                            confirmpassword: self.form.confirmpassword
                        },
                        success(res) {
                            showMessage(self, res.msg, true);
                            setTimeout(function () {
                                window.location.href = '/main/myaccount';
                            }, 1500);
                        },
                        error(res) {
                            showMessage(self, res.msg);
                        }
                    });
                    self.loging = false;
                }
            },
            created() {
                var self = this;
                PF.dropdownalbums(self);
            }
        });
    </script>
}

